package com.jishuo.pzk;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.nio.charset.Charset;

@Slf4j
@Component
public class ApplicationListener implements CommandLineRunner, DisposableBean {
    @Override
    public void destroy() throws Exception {
        log.info("应用正在关闭。");
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("应用启动成功。");
        log.info("系统编码：" + Charset.defaultCharset().name());
    }
}
